<template>
	<view>
		<status-bar title="新闻详情" />
		<view class="main">
			<view class="size44 color-222 bold line66">{{ pageData.title }}</view>
			<view class="d-flex j-sb m-top40 m-bot40">
				<view class="size26 color-666">浏览量：{{ pageData.views }}</view>
				<view class="size26 color-999">{{ pageData.publishTime }}</view>
			</view>
			<up-parse :content="pageData.content" :domain="domain"></up-parse>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { domain } from '@/utils/config.js'
	import { Toast } from '@/utils/utils.js'
	import Http from '@/utils/request.js'
	import statusBar from '../components/statusBar.vue'
	
	const id = ref('')
	const pageData = ref('')
	
	onLoad((e) => {
		if(e.id) id.value = e.id
		getInfo()
	})
	
	const getInfo = () => {
		Http.get({
			url: '/hr/getArticle',
			data: {
				id: id.value
			}
		}).then(res => {
			if(res.code != 0) return Toast(res.msg)
			pageData.value = res.data
		})
	}
</script>

<style lang="scss" scoped>
	.main {
		padding: 50rpx 30rpx;
	}
</style>
